package design.mode.procedure.mysql.controller;

import design.mode.procedure.mysql.bean.Product;
import design.mode.procedure.mysql.service.ProductService;
import design.mode.procedure.mysql.service.func.MyFunctionalInterface;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringValueResolver;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ProductController {
    @Autowired
    private ProductService productService;
    @Autowired
    private MyFunctionalInterface functionalInterface;

    @PostMapping("/market")
    public List queryMarketPriceResult() {
        return productService.queryMarketPriceResult();
    }

    @PostMapping("/procedure")
    public void queryProductInfo(int price) {
        System.out.println(functionalInterface.getResult(2));
        productService.queryProductInfo(price);
    }
}
